home *** CD-ROM | disk | FTP | other *** search
- on riga RecSelect
- global gMaxMulti, gRowsMulti
- if RecSelect > gRowsMulti then
- return gRowsMulti
- end if
- if RecSelect < 1 then
- return 1
- end if
- return ((RecSelect - 1) mod gRowsMulti) + 1
- end
-
- on PagListaOfRec RecSelect
- global gRowsMulti
- if (RecSelect mod gRowsMulti) > 0 then
- return (RecSelect / gRowsMulti) + 1
- else
- return RecSelect / gRowsMulti
- end if
- end
-
- on PosizioneRiga RecSelect
- global interlineaLista
- set magg to 1
- if RecSelect < 1 then
- return -1000
- end if
- return the locV of sprite 28 + (interlineaLista * (riga(RecSelect) - 1)) + magg
- end
-
- on NextPrevious direzione
- global gMaxMulti, gCurrMulti, interlineaLista, gRowsMulti, CurPage
- if the mouseDown then
- set xmouse to 1
- end if
- set CurRiga to riga(gCurrMulti)
- set CurPage to PagListaOfRec(gCurrMulti)
- if direzione = 1 then
- set Minimo to 0
- set Massimo to gMaxMulti
- else
- set Minimo to 1
- set Massimo to gMaxMulti + 1
- end if
- if (gCurrMulti > Minimo) and (gCurrMulti < Massimo) then
- RipetizioneTasto(direzione)
- end if
- repeat with i = 1 to 20000
- end repeat
- if xmouse then
- repeat while the stillDown and (gCurrMulti > Minimo) and (gCurrMulti < Massimo)
- RipetizioneTasto(direzione)
- end repeat
- else
- repeat while ((the keyPressed = "") or (the keyPressed = "")) and (gCurrMulti > Minimo) and (gCurrMulti < Massimo)
- RipetizioneTasto(direzione)
- end repeat
- end if
- ImpostaControls()
- end
-
- on RipetizioneTasto direzione
- global gMaxMulti, gCurrMulti, CurPage, gRowsMulti, glineHeightMulti
- set gCurrMulti to gCurrMulti + direzione
- set the scrollTop of member "fOnOffMulti" to (gCurrMulti - 1) * glineHeightMulti
- set the scrollTop of member "fSourceList" to (gCurrMulti - 1) * glineHeightMulti
- set the scrollTop of member "fDestList" to (gCurrMulti - 1) * glineHeightMulti
- updateStage()
- end
-
- on FirstLast direzione
- global gTable, gMaxMulti, gCurrMulti, interlineaLista, gRowsMulti, CurPage, VARListaRicette, VARListaEditabili, VARListaPreferite
- if objectp(gTable) then
- if gMaxMulti > 0 then
- set CurRiga to riga(gCurrMulti)
- set CurPage to PagListaOfRec(gCurrMulti)
- if direzione = 1 then
- mGoLast(gTable)
- else
- mGoFirst(gTable)
- end if
- set gCurrMulti to mGetPosition(gTable)
- put gCurrMulti into field "fgCurrMulti"
- if the frameLabel = "Lista" then
- set the locV of sprite 27 to PosizioneRiga(gCurrMulti)
- set NewCurPage to PagListaOfRec(gCurrMulti)
- if CurPage <> NewCurPage then
- set CurPage to NewCurPage
- set fromRec to 1 + ((CurPage - 1) * gRowsMulti)
- set toRec to fromRec + gRowsMulti - 1
- if toRec > gMaxMulti then
- set toRec to gMaxMulti
- end if
- RiempiLista()
- end if
- updateStage()
- end if
- end if
- else
- AlertBox("Errore DataBase Ricettario")
- end if
- end
-
- on NextPreviousPage direzione
- global gTable, gMaxMulti, gCurrMulti, interlineaLista, gRowsMulti, CurPage, VARListaRicette, VARListaEditabili, VARListaPreferite
- if objectp(gTable) then
- if gMaxMulti > 0 then
- set CurRiga to riga(gCurrMulti)
- set CurPage to PagListaOfRec(gCurrMulti)
- set ok to 0
- if direzione = 1 then
- set NewgCurrMulti to 1 + (CurPage * gRowsMulti)
- else
- set NewgCurrMulti to 1 + ((CurPage - 2) * gRowsMulti)
- end if
- if (NewgCurrMulti > 0) and (NewgCurrMulti <= gMaxMulti) then
- mGo(gTable, NewgCurrMulti)
- set gCurrMulti to mGetPosition(gTable)
- put gCurrMulti into field "fgCurrMulti"
- set the locV of sprite 27 to PosizioneRiga(gCurrMulti)
- set CurPage to PagListaOfRec(gCurrMulti)
- set fromRec to 1 + ((CurPage - 1) * gRowsMulti)
- set toRec to fromRec + gRowsMulti - 1
- if toRec > gMaxMulti then
- set toRec to gMaxMulti
- end if
- RiempiLista()
- else
- FirstLast(direzione)
- end if
- ImpostaThumb()
- end if
- else
- put "Apri il database prima!"
- end if
- end
-
- on RiempiLista
- global gTable, gMaxMulti, gCurrMulti, RecTotal, CurPage, gRowsMulti, ListaCompleta
- set ListaCompleta to 0
- if gMaxMulti > 0 then
- set CurPage to PagListaOfRec(gCurrMulti)
- set fromRec to 1 + ((CurPage - 1) * gRowsMulti)
- set toRec to gRowsMulti
- if (fromRec + toRec - 1) > gMaxMulti then
- set toRec to gMaxMulti - fromRec + 1
- end if
- put mGetSelection(gTable, "Literal", fromRec, toRec, " ", RETURN, "IsRead", "Titolo") into field "fLstTitoli"
- mGo(gTable, gCurrMulti)
- ImpostaControls()
- else
- set gCurrMulti to 0
- set CurPage to 0
- put EMPTY into field "fLstTitoli"
- set the locV of sprite 27 to -1000
- end if
- end
-
- on SelezionaRecord
- global gTable, gMaxMulti, gCurrMulti, CurPage, gRowsMulti
- set NewgCurrMulti to the mouseLine + ((CurPage - 1) * gRowsMulti)
- if (NewgCurrMulti <= gMaxMulti) and (gMaxMulti > 0) then
- set gCurrMulti to NewgCurrMulti
- mGo(gTable, gCurrMulti)
- ImpostaControls()
- end if
- end
-
- on ImpostaControls
- global gCurrMulti, gMaxMulti, LastRigaGlossClick
- if gCurrMulti < 2 then
- set the locV of sprite 27 to the top of sprite 31
- else
- if gCurrMulti = gMaxMulti then
- set the locV of sprite 27 to the bottom of sprite 31
- end if
- end if
- updateStage()
- end
-
- on ImpostaThumb
- global gCurrMulti, gMaxMulti
- set dest to (float(the height of sprite 31) / float(gMaxMulti - 1) * float(gCurrMulti - 1)) + the top of sprite 31
- set the locV of sprite 27 to dest
- updateStage()
- end
-